package com.gticket.customerbackend.mapper;

import com.gticket.customerbackend.pojo.Cinema;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CinemaMapper {

    /**
     * 通过影院id查询影院的所有信息
     * @param
     * @return  Cinema
     */
    @Select("select * from ${database}.cinema  where flag=0")
    List<Cinema> listCinemas(Cinema cinema);

    @Select("select * from ${database}.cinema  where cinema_id=#{cinema_id} and flag=0")
    Cinema getCinemaByCinema_id(Cinema cinema);


//    @Insert("insert into ${database}.Cinema(cinema_name,min_score,max_score,discount) values(#{level_name},#{min_score},#{max_score},#{discount})")
//    void insertLevel(Cinema cinema);


    @Update("update ${database}.cinema set  cinema_name=#{cinema_name},cinema_address=#{cinema_address}  where cinema_id=#{cinema_id}")
    void updateCinema(Cinema cinema);

    @Delete("delete from ${database}.cinema where cinema_id=#{cinema_id}")
    void deleteCinema(Cinema cinema);

}
